import ElementPlus from 'element-plus';
import locale from 'element-plus/lib/locale/lang/zh-CN';
import * as ElementPlusIconsVue from '@element-plus/icons-vue';

import { createApp } from 'vue';

/**
 * 安装element-plus组件
 * @param app 要安装的app
 */
function installElementPlus (app: ReturnType<typeof createApp>) {
  /* app.use(ElButton, { locale });
  app.use(ElScrollbar, { locale });
  app.use(ElConfigProvider, { locale });
  app.use(ElForm, { locale });
  app.use(ElFormItem, { locale });
  app.use(ElInput, { locale });
  app.use(ElDropdown, { locale });
  app.use(ElIcon, { locale });
  app.use(ElTable, { locale });
  app.use(ElTableColumn, { locale });
  app.use(ElDropdownItem, { locale });
  app.use(ElMenu, { locale });
  app.use(ElMenuItem, { locale });
  app.use(ElSubMenu, { locale });
  app.use(ElPagination, { locale }); */
  app.use(ElementPlus, { locale });
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
  }
}

export default installElementPlus;
